;Assembler header file for DMA
;written by DefMod (Dec 31 2005) on Sat Dec 31 14:03:53 2005
;Jonathan Coxhead, jonathan@doves.demon.co.uk, 29 June 1995

        [       :LNOT: :DEF: DMA_Hdr
        GBLS    DMA_Hdr

        [       :LNOT: :DEF: Get_Types
        GBLS    Get_Types
        ]
        [       :LNOT: :DEF: Types_Hdr
Get_Types                       SETS    "GET oslib/Types.Hdr"
        |
Get_Types                       SETS    ""
        ]
        $Get_Types

        [       :LNOT: :DEF: Get_OS
        GBLS    Get_OS
        ]
        [       :LNOT: :DEF: OS_Hdr
Get_OS                          SETS    "GET oslib/OS.Hdr"
        |
Get_OS                          SETS    ""
        ]
        $Get_OS

;Symbols for constants
DMA_QueueWrite                  *       &1
DMA_QueueCircularList           *       &2
DMA_QueueUseSync                *       &4
DMA_SuspendStartNext            *       &1

;Symbols for structure offsets and sizes
DMA_C                           *       4 ;abstract type
DMA_Tag                         *       4 ;abstract type
                                ^       0
DMA_Routines_enable             #       Ptr
DMA_Routines_disable            #       Ptr
DMA_Routines_start              #       Ptr
DMA_Routines_completed          #       Ptr
DMA_Routines_sync               #       Ptr
DMA_Routines                    *       @

                                ^       0
DMA_Scatter_address             #       Ptr
DMA_Scatter_size                #       Int
DMA_Scatter                     *       @

                                ^       0
DMA_ScatterList_s               #       DMA_Scatter
DMA_ScatterList                 *       @

                                ^       0
                                #       Bits
DMA_RegisterChannelFlags        *       @

                                ^       0
                                #       Bits
DMA_QueueFlags                  *       @

                                ^       0
                                #       Bits
DMA_SuspendFlags                *       @

                                ^       0
                                #       Bits
DMA_ResumeFlags                 *       @

                                ^       0
                                #       Bits
DMA_ExamineFlags                *       @


;Symbols for SWI's and SWI reason codes
XDMA_RegisterChannel            *       &66140
DMA_RegisterChannel             *       &46140
   ;Entry
   ;  R0 = flags (DMA_RegisterChannelFlags)
   ;  R1 = log_channel (Int)
   ;  R2 = cycle_speed (Int)
   ;  R3 = transfer_size (Int)
   ;  R4 -> control_routines (DMA_Routines)
   ;  R5 = workspace (pointer to Void)
   ;Exit
   ;  R0 = channel (DMA_C)

XDMA_DeregisterChannel          *       &66141
DMA_DeregisterChannel           *       &46141
   ;Entry
   ;  R0 = channel (DMA_C)

XDMA_QueueTransfer              *       &66142
DMA_QueueTransfer               *       &46142
   ;Entry
   ;  R0 = flags (DMA_QueueFlags)
   ;  R1 = channel (DMA_C)
   ;  R2 = workspace (pointer to Void)
   ;  R3 -> scatter_list (DMA_ScatterList)
   ;  R4 = transfer_size (Int)
   ;  R5 = buffer_size (Int)
   ;  R6 = sync_size (Int)
   ;Exit
   ;  R0 = tag (DMA_Tag)

XDMA_TerminateTransfer          *       &66143
DMA_TerminateTransfer           *       &46143
   ;Entry
   ;  R0 -> error (OS_Error)
   ;  R1 = tag (DMA_Tag)

XDMA_SuspendTransfer            *       &66144
DMA_SuspendTransfer             *       &46144
   ;Entry
   ;  R0 = flags (DMA_SuspendFlags)
   ;  R1 = tag (DMA_Tag)

XDMA_ResumeTransfer             *       &66145
DMA_ResumeTransfer              *       &46145
   ;Entry
   ;  R0 = flags (DMA_ResumeFlags)
   ;  R1 = tag (DMA_Tag)

XDMA_ExamineTransfer            *       &66146
DMA_ExamineTransfer             *       &46146
   ;Entry
   ;  R0 = flags (DMA_ExamineFlags)
   ;  R1 = tag (DMA_Tag)
   ;Exit
   ;  R0 = transferred_size (Int)

        ]
        END
